using System.Collections;
using UnityEngine;

public class BlockPanel : MonoBehaviour
{
	private void OnEnable()
	{
		StartCoroutine(DisableCorutine());
		if (LobbyPlayerGunManager.instance != null && LobbyPlayerGunManager.instance.lightObj != null)
		{
			LobbyPlayerGunManager.instance.lightObj.gameObject.SetActive(false);
		}
	}

	private IEnumerator DisableCorutine()
	{
		yield return StartCoroutine(CoroutineRunner.WaitForSeconds(10f));
		base.gameObject.SetActive(false);
		if (LobbyPlayerGunManager.instance != null && LobbyPlayerGunManager.instance.lightObj != null)
		{
			LobbyPlayerGunManager.instance.lightObj.gameObject.SetActive(true);
		}
	}

	private void OnDisable()
	{
		StopCoroutine(DisableCorutine());
		if (LobbyPlayerGunManager.instance != null && LobbyPlayerGunManager.instance.lightObj != null)
		{
			LobbyPlayerGunManager.instance.lightObj.gameObject.SetActive(true);
		}
	}
}
